#ifndef __LOG_H__
#define __LOG_H__
#include <pthread.h>
#include <string>
#include <fstream>

using namespace std;

class Log
{
    private:
        pthread_mutex_t theMutex;
        static Log* instance;
        static int reference_count;
        ofstream outfile;

        
        void destroy();

    public:
	Log();
        ~Log();
        pthread_mutex_t* getMutex();
        void logMessage(string message);
        void logMessageCreate(int id);
        void logMessageExit(int id);
        void logMessageExitFail(int id, string message);
        void logMessageWarning(string message);
        void init();
        void release();
	void mutexLock();
	void mutexUnlock();
        static Log* getInstance();

};

#endif
